package com.easy.query.test.entity.school.proxy;

import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLColumn;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.easy.query.core.proxy.core.EntitySQLContext;
import com.easy.query.test.entity.school.SchoolClassAggregate;
import com.easy.query.core.proxy.columns.types.SQLStringTypeColumn;
import com.easy.query.core.proxy.columns.SQLNavigateColumn;
import com.easy.query.core.proxy.columns.SQLManyQueryable;
import com.easy.query.core.proxy.columns.types.SQLAnyTypeColumn;
import com.easy.query.core.proxy.columns.types.SQLLongTypeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author easy-query
 */
public class SchoolClassAggregateProxy extends AbstractProxyEntity<SchoolClassAggregateProxy, SchoolClassAggregate> {

    private static final Class<SchoolClassAggregate> entityClass = SchoolClassAggregate.class;

    public static final SchoolClassAggregateProxy TABLE = createTable().createEmpty();

    public static SchoolClassAggregateProxy createTable() {
        return new SchoolClassAggregateProxy();
    }

    public SchoolClassAggregateProxy() {
    }

    /**
     * {@link SchoolClassAggregate#getId}
     */
    public SQLStringTypeColumn<SchoolClassAggregateProxy> id() {
        return getStringTypeColumn("id");
    }

    /**
     * {@link SchoolClassAggregate#getName}
     */
    public SQLStringTypeColumn<SchoolClassAggregateProxy> name() {
        return getStringTypeColumn("name");
    }

    /**
     * 一对多 一个班级多个学生
     * {@link SchoolClassAggregate#getSchoolStudents}
     */
    public SQLManyQueryable<SchoolClassAggregateProxy, com.easy.query.test.entity.school.proxy.SchoolStudentProxy, com.easy.query.test.entity.school.SchoolStudent> schoolStudents() {
        return getNavigateMany("schoolStudents", new com.easy.query.test.entity.school.proxy.SchoolStudentProxy());
    }

    /**
     * {@link SchoolClassAggregate#getStudentSize}
     */
    public SQLLongTypeColumn<SchoolClassAggregateProxy> studentSize() {
        return getLongTypeColumn("studentSize");
    }


    @Override
    public Class<SchoolClassAggregate> getEntityClass() {
        return entityClass;
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public SchoolClassAggregateProxyFetcher FETCHER = new SchoolClassAggregateProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class SchoolClassAggregateProxyFetcher extends AbstractFetcher<SchoolClassAggregateProxy, SchoolClassAggregate, SchoolClassAggregateProxyFetcher> {

        public SchoolClassAggregateProxyFetcher(SchoolClassAggregateProxy proxy, SchoolClassAggregateProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link SchoolClassAggregate#getId}
         */
        public SchoolClassAggregateProxyFetcher id() {
            return add(getProxy().id());
        }

        /**
         * {@link SchoolClassAggregate#getName}
         */
        public SchoolClassAggregateProxyFetcher name() {
            return add(getProxy().name());
        }

        /**
         * {@link SchoolClassAggregate#getStudentSize}
         */
        public SchoolClassAggregateProxyFetcher studentSize() {
            return add(getProxy().studentSize());
        }


        @Override
        protected SchoolClassAggregateProxyFetcher createFetcher(SchoolClassAggregateProxy cp, AbstractFetcher<SchoolClassAggregateProxy, SchoolClassAggregate, SchoolClassAggregateProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new SchoolClassAggregateProxyFetcher(cp, this, sqlSelectExpression);
        }
    }

}
